package com.zzy.demo.config;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;


/**
 * 
 * @author guokaige
 *
 */
@WebListener
public class SessionListener implements HttpSessionListener {


	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		
//		HttpSession session = arg0.getSession();
//		String token = (String) session.getAttribute("token");
//		System.out.println("监听session创建----"+token);
		
	}
	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		
		HttpSession session = arg0.getSession();
		String token = (String) session.getAttribute("token");
		System.out.println("监听session失效"+token);

	}
	
	
	
	
}